#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<string.h>



char* my_strncat(char* dest,const char* src,int n)
{
	char* ret = dest;
	while (*dest != '\0')
	{
		dest++;
	}
	int i = 0;
	while(*src!='\0')
	{
		*dest= *src;
		src++;
		dest++;
		i++;
		if (i >= n)
			break;
	}
	return ret;
}
int main()
{
	char arr[50] = "a";
	char* str = "defg";
	my_strncat(arr, str,3);
	printf("%s\n", arr);
	return 0;
}

